home *** CD-ROM | disk | FTP | other *** search
/ Programmer Plus 2007 / Programmer-Plus-2007.iso / Programming / XML Utilities / Professional Programmer XSL IDE / Xselerator25.msi / Data.Cab / F38058_testPartialSumsList.xsl < prev    next >
Encoding:
Extensible Markup Language  |  2002-01-20  |  1.3 KB  |  42 lines

  1. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  2. xmlns:saxon="http://icl.com/saxon"
  3. xmlns:IntegralFunction="IntegralFunction"
  4. exclude-result-prefixes="xsl IntegralFunction"
  5. >
  6.   <xsl:import href="partialSumsList.xsl"/>
  7.  
  8.   <!-- To be applied on any source xml.
  9.        Calculates the partial sums for 
  10.        the Integral of x^2 in the interval [0,1] 
  11.        with precision 0.001
  12.     -->
  13.   
  14.   <xsl:output indent="yes" omit-xml-declaration="yes"/>
  15.   
  16.   <IntegralFunction:IntegralFunction/>
  17.  
  18.   <xsl:template match="/">
  19.     <xsl:variable name="vMyFun" select="document('')/*/IntegralFunction:*[1]"/>
  20.  
  21.     <xsl:variable name="vrtfPartialSums">
  22.       <xsl:call-template name="partialSumsList">
  23.           <xsl:with-param name="pFun" select="$vMyFun"/>
  24.           <xsl:with-param name="pA" select="0"/>
  25.           <xsl:with-param name="pB" select="1"/>
  26.           <xsl:with-param name="pEps" select="0.001"/>
  27.       </xsl:call-template>
  28.     </xsl:variable>
  29.     
  30.     <xsl:variable name="vPartialSums" select="saxon:node-set($vrtfPartialSums)/*"/>
  31.     
  32.     <xsl:copy-of select="$vPartialSums"/>
  33.     
  34.  
  35.   </xsl:template>
  36.   <xsl:template name="myIntegralFn" match="*[namespace-uri()='IntegralFunction']">
  37.     <xsl:param name="pX"/>
  38.  
  39.     <xsl:value-of select="$pX * $pX"/>
  40.   </xsl:template>
  41.  
  42. </xsl:stylesheet>